<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://community.wanqing.com/tag/functions" prefix="fun"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <base href="<%=basePath%>"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>销售管理系统</title>
    <link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css"/>
    <link rel="stylesheet" type="text/css" href="easyui/themes/icon.css" />
    <link rel="stylesheet" type="text/css" href="css/menu.css" />
    <link rel="stylesheet" type="text/css" href="css/tree.css" />

    <script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
    <style type="text/css">
        <!--
        body {
            margin-left: 0px;
            margin-top: 0px;
            margin-right: 0px;
            margin-bottom: 0px;
        }
        .STYLE1 {
            color: #43860c;
            font-size: 12px;
        }
        #
        .txt01{font:Verdana, Geneva, sans-serif,宋体;padding:3px 2px 2px 2px; border-width:1px; border-color:#ddd;  color:#000;}
        .td_save{background-color:#F9FBFD;text-align:right;padding-right:3px;font-size: 13px;}
        .input{ vertical-align:text-top;border:1px solid #09C;height:20px;line-height:20px;}
        .table_save{background-color:#B4CFCF;margin-left: 5px;margin-bottom: 5px;}
        .table_save tr{background-color:#FFFFFF;}
        .text_read{background:#EEEEEE;height:20px;border:1px solid #DBDBDB;width:150px;}
        .accordion-body{
            height:auto !important;
        }
        .easyui-accordion{
            height:auto !important;
        }
        .table_save td{
            font-size: 16px !important;
        }
    </style>
</head>
<body  class="easyui-layout" style="overflow-y: auto"  fit="true" scroll="no" onload="clickFirst();">
<div region="north" style="overflow: hidden; height: 61px;">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" style="table-layout:fixed;">
        <tr>
            <td height="9" style="line-height:9px; background-image:url(images/header/main_04.gif)"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="97" height="9" background="images/header/main_01.gif">&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
            </table></td>
        </tr>
        <tr>
            <td height="47" background="images/header/main_09.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="38" height="47" background="images/header/main_06.gif">&nbsp;</td>
                    <td width="59"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td height="29" background="images/header/main_07.gif">&nbsp;</td>
                        </tr>
                        <tr>
                            <td height="18" background="images/header/main_14.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0" style="table-layout:fixed;">
                                <tr>
                                    <td  style="width:1px;">&nbsp;</td>
                                    <td ><span class="STYLE1" style="color: blue;">${sessionScope.admin.loginName }</span></td>
                                </tr>
                            </table></td>
                        </tr>
                    </table></td>
                    <td width="155" background="images/header/main_08.gif">&nbsp;</td>
                    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td height="23" valign="bottom"><img src="images/header/main_12.gif" width="367" height="23" border="0" usemap="#Map" /></td>
                        </tr>
                    </table></td>
                    <td width="200" background="images/header/main_11.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="11%" height="23">&nbsp;</td>
                            <td width="89%" valign="bottom"><span style="color: blue;" class="STYLE1" id="logtime"></span></td>
                        </tr>
                    </table></td>
                </tr>
            </table></td>
        </tr>
        <tr>
            <td height="5" style="line-height:5px; background-image:url(images/header/main_18.gif)"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="180" background="images/header/main_16.gif"  style="line-height:5px;">&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
            </table></td>
        </tr>
    </table>
    <map name="Map" id="Map">
        <area shape="rect" coords="3,1,49,22" href="javascript:void(0);" onclick="document.location.href=document.location.href;" />
        <area shape="rect" coords="52,2,95,21" href="javascript:void(0);" />
        <area shape="rect" coords="102,2,144,21" href="javascript:void(0);" />
        <area shape="rect" coords="150,1,197,22" href="javascript:void(0);" onclick="reload();"/>
        <area shape="rect" coords="210,2,304,20" href="javascript:void(0);" onclick="updatePwd();"/>
        <area shape="rect" coords="314,1,361,23" href="javascript:void(0);" onclick="logout();"/>
    </map>
</div>
<div region="west" split="true"  title="导航菜单" style="width:200px;" id="myaccrdion" class="easyui-accordion" iconCls="icon-accordion">
    <c:forEach items="${listMainMenu}" var="pmenu">
        <div title="${pmenu.mname }" iconCls="${pmenu.iconCls }">
            <ul class="navlist" sizset="true">
                <c:forEach items="${pmenu.childrens}" var="cmenu">${cmenu.mstate }
                    <li sizset="true">
                        <div sizset="false">
                            <a href="javascript:void(0);" ref="${pmenu.mid }_${cmenu.mid }" rel="${fun:mainMenuUrl(cmenu.murl,cmenu.mid) }"><span class="icon ${cmenu.iconCls }">&nbsp;</span><span class="nav">${cmenu.mname }</span></a>
                        </div>
                    </li>
                </c:forEach>
            </ul>
        </div>
    </c:forEach>
</div>
<div id="mainPanle" region="center" style="background: #eee; overflow-y:hidden ">
    <div id="tabs" class="easyui-tabs"  fit="true" border="false" >
        <div title="欢迎使用" style="padding:20px;overflow:true;" >
            <div style="overflow:auto;">
                <div style="overflow:auto;">
                    <center><h6 style="color: blue;font-size:xx-large; ">欢迎使用销售管理系统</h6> </center>

                </div>
            </div>
        </div>
    </div>
</div>
<div id="pwdWin" class="easyui-window" title="修改密码" collapsible="false" minimizable="false"
     maximizable="false" closed="true" modal="true" icon="icon-save"  style="width: 300px; height: 180px; padding: 5px;
        background: #fafafa;">
    <div class="easyui-layout" fit="true">
        <div region="center" border="false" style="padding: 10px; background: #fff; border: 1px solid #ccc;">
            <form name="saveForm" id="saveForm" method="post">
                <table cellpadding="1" cellspacing="1" class="table_save">
                    <tr>
                        <td class="td_save">账号：</td>
                        <td><input type="text" class="input" value="${sessionScope.admin.loginName }" disabled="disabled"/></td>
                    </tr>
                    <tr>
                        <td class="td_save">新密码：</td>
                        <td><input type="password" id="txtNewPass" name="loginPwd" class="input easyui-validatebox" data-options="required:true"/></td>
                    </tr>
                    <tr>
                        <td class="td_save">确认密码：</td>
                        <td><input type="password" id="txtRePass" class="input easyui-validatebox" data-options="required:true"/>
                            <input type="hidden" name="userId" value="${sessionScope.admin.id }">
                        </td>
                    </tr>
                </table>
            </form>
        </div>
        <div region="south" border="false" style="text-align: center; height: 30px; line-height: 30px;">
            <a id="btnEp" class="easyui-linkbutton" icon="icon-ok" href="javascript:void(0)" >确定</a>
            <a id="btnCancel" class="easyui-linkbutton" icon="icon-cancel" href="javascript:void(0)">取消</a>
        </div>
    </div>
</div>
<input type="text" id="loginUser" name="loginUser" value="${sessionScope.admin.id }"/>
<div id="addWin"></div>
<div id="updateWin"></div>
<div id="checkWin"></div>
</body>
<script type="text/javascript" src="easyui/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="js/StringBuffer.js"></script>
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript" src="pages/main.js?v=<%=Math.random() %>"></script>
<script type="text/javascript" src="js/layer-v1.8.5/layer/layer.min.js"></script>
<script type="text/javascript" src="js/jQuery.timers.js"></script>

<script type="text/javascript">
    $(document).ready(function() {
        loadMessage();
        $('body').everyTime('1000s',function(){
            var exist = $(".xubox_border").length;
            if(exist == 0){
                loadMessage();
            }
        });
    })
    function loadMessage(){
        $.ajax({
            cache: false,
            type: "POST",
            url:'message.do?method=index&type=show',
            data:$('#messages').serialize(),// 你的formid
            async: false,
            error: function(request) {
            },
            success: function(msg) {
                showMessage();
            }
        });
    }
    function showMessage(){
        $.layer({
            type: 2,   //0-4,
            title: '系统消息',
            border: [2, 0.3, '#000'],
            shade:[0],
            area: ['450px', '290px'],
            shift: 'right-bottom',
            iframe: {
                src: 'message.do?method=index&type=list',
                scrolling: 'no'
            }
        });
    }

</script>
<script type="text/javascript">
    function clickFirst(){
        $(".accordion-collapse:first").click();
    }
</script>
</html>